/*
 * Daniel R Padilla
 *
 * Copyright (c) 2008, Daniel R Padilla
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */
package org.databasefacade.translator;

import java.util.ArrayList;

import org.databasefacade.exception.DatabaseFacadeException;
import org.databasefacade.select.From;
import org.databasefacade.select.QueryHints;
import org.databasefacade.select.Where;
import org.databasefacade.table.Table;
import org.databasefacade.table.column.Column;
import org.databasefacade.table.column.datatype.DataType;
import org.databasefacade.update.Update;

public interface Translator {
	
	/*
	 * Create table methods
	 */
	public String createTableSQL(Table table, Column primaryKey) throws DatabaseFacadeException;
	
	/*
	 * Select translation methods
	 */
	public String getSelectColumn(String column, String tableAlias, String columnAlias);
	
	/**
	 * MySQL and Oracle list their hints in the select section
	 * of the SQL. So the hints are passed here to allow the
	 * translator to implement database specific hints when
	 * supported.
	 */
	public String getSelectHintSQL(QueryHints hints);
	public QueryHints getQueryHints();
	
	/*
	 * Update SQL Translation method
	 */
	public String getUpdateSQL(Update update, From from, Where where);
	
	/*
	 * Data Type translation methods
	 */
	public String getDataTypeSQL(DataType type);
	
	/*
	 * Assign function sql
	 */
	public String getFunctionSQL(String functionType, ArrayList parameters);
	
	/*
	 * Join method translation
	 */
	public short getJoinNotationMode();
	public String getAnsiJoinExtendedSQL(short joinType, String table, String alias, QueryHints hints);
	public String buildNativeFromSQL(From from, Where where);
	public String buildNativeWhereSQL(From from, Where where);
	
	/*
	 * Key type information
	 */
	public void setKeyDataTypeSQL(String sqlType);
	public String getKeyDataTypeSQL();
	public void setKeyJavaType(String javaType);
	public String getKeyJavaType();
	public void setKeyLength(short len);
	public short getKeyLength();
	
	public void setStringDelimiter(String s);
	public String getStringDelimiter();
}
